﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

using Microsoft.Practices.Composite.Modularity;
using Microsoft.Practices.Composite.Regions;
using Microsoft.Practices.Unity;
using DevFX.Infrastructure;

namespace DevFX.Modules.Passport
{
    public class PassportModule : IModule
    {
        private readonly IUnityContainer container = null;
        private readonly IRegionManager regionManager = null;

        public PassportModule(IUnityContainer container, IRegionManager regionManager)
        {
            this.container = container;
            this.regionManager = regionManager;
        }

        #region IModule 成员

        public void Initialize()
        {
            RegisterServices();
            DefaultView view = container.Resolve<DefaultView>();
            regionManager.AddToRegion(PassportRegionNames.MainRegion, view);

            view.Display();
        }

        #endregion

        private void RegisterServices()
        {
            container.RegisterType<DefaultView, DefaultView>();
        }
    }
}
